<template>
  <div id="app">
    <div class="water-mark">Power by♥ imchen</div>
    <div class="menu">
      <span @click="toggleMenu" class="menu-icon">菜单</span>
      <ul class="menu-list" v-bind:class="{active:isShown}">
        <li
          v-for="(itemKey,index) in menuItemKey"
          v-bind:key="itemKey"
          v-bind:class="['menu-item']"
          v-on:click="currentItem=itemKey"
        >{{menuItemValue[index]}}</li>
      </ul>
    </div>
    <!-- <PackageInfo /> -->
    <component v-bind:is="currentTabComponent"></component>
  </div>
</template>

<script>
import PackageInfo from "./components/PackageInfo.vue";
import IssueFix from "./components/IssueFix.vue";
import PakcageParseHistory from "./components/PackageParseHistory.vue";

export default {
  name: "App",
  components: {
    PackageInfo,
    IssueFix,
    PakcageParseHistory
  },
  data: function () {
    return {
      menuItemKey: ["PackageInfo", "IssueFix", "PakcageParseHistory", "test2", "test3"],
      menuItemValue: ["解析APK", "修复Bug", "历史记录", "test2", "test3"],
      currentItem: "PackageInfo",
      isShown: false,
    };
  },
  methods: {
    toggleMenu: function () {
      if (this.isShown) {
        this.isShown = false;
      } else {
        this.isShown = true;
      }
      console.log("menu show: " + this.isShown);
    },
  },
  computed: {
    currentTabComponent: function () {
      return this.currentItem;
    },
  },
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* text-align: center; */
  color: #2c3e50;
}
.water-mark {
  z-index: 999;
  width: 80px;
  font-weight: bold;
  font-size: 1rem;
  position: absolute;
  right: 0;
  color: rgb(209, 132, 180);
  background-color: #23c0b34b;
  display: inline-block;
  border-style: solid;
  border-radius: 30px 0px 0px 30px;
  border-width: 2px 0px 2px 2px;
  border-color: #23c0b3;
  padding-left: 6px;
  text-align: center;
  transition: all 0.5s ease-in-out;
}
.water-mark:hover {
  color: rgb(221, 9, 9);
  background-color: #0a8f86;
}

/* Menu start */
.menu {
  position: fixed;
  background-color: rgb(82, 64, 97);
  transition: all 1s ease-in-out;
}
.menu-icon {
  width: 50px;
  height: 50px;
}
.menu-list {
  /* width: 0;
  height: 0; */
  overflow: hidden;
  cursor: pointer;
  transition: all 1s ease-in-out;
}
.menu-item {
  color: cadetblue;
  padding: 5px;
  background-size: 0%;
  transition: all 0.5s ease-in-out;
}
.menu-item.active {
  background-color: blue;
}
.menu-item:hover {
  color: aqua;
  background: cornflowerblue;
  background-size: 50%;
}
.active {
  width: 200px;
  height: 200px;
}
/* Menu end */
</style>
